<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <title>Document</title>
    <style>
        ul {
            width: 200px;
            margin: 100px auto;
            padding: 0;
        }

        li {
            list-style: none;
            height: 40px;
            line-height: 40px;
            border: 1px solid #cccccc;
            text-align: center;
            margin: 10px 0;
            cursor: pointer;
        }
    </style>
</head>
<body>
<ul>
    <li>1+1+1</li>
    <li>2+2+2</li>
    <li>3+3+3</li>
    <li>4+4+4</li>
    <li>5+5+5</li>
    <li>6+6+6</li>
</ul>
</body>
<script>
    $(function () {
        $("li").mouseover(function () {
            $(this).css("backgroundColor", "hotpink").siblings().css("backgroundColor", "white");
        }).mouseout(function () {
            $(this).css("backgroundColor", "white").siblings().css("backgroundColor", "white");
        }).mousedown(function () {
            $(this).prevAll().css("backgroundColor", "greenyellow").end().nextAll().css("backgroundColor", "skyblue");
        }).mouseup(function () {
            $(this).siblings().css("backgroundColor", "white");
        })
    });
</script>
</html>